/* Important: you need to put the .dat and .do files in one folder/
   directory and then set the working folder to that folder. */

set more off

clear
infix ///
 byte    region                               1-2 ///
 byte    statefip                             3-4 ///
 byte    metro                                5 ///
 byte    gq                                   6 ///
 int     age                                  7-9 ///
 byte    sex                                 10 ///
 byte    marst                               11 ///
 int     race                                12 ///
 long    bpl                                 13-15 ///
 int     yrimmig                             16-19 ///
 int     educd                               20-22 ///
 byte    empstat                             23 ///
 byte    classwkr                            24 ///
 byte    wkswork1                            25-26 ///
 byte    uhrswork                            27-28 ///
 long    incwage                             29-34 ///
 using usa_00029.dat

label var region `"Census region and division"'
label var statefip `"State (FIPS code)"'
label var metro `"Metropolitan status"'
label var gq `"Group quarters status"'
label var age `"Age"'
label var sex `"Sex"'
label var marst `"Marital status"'
label var race `"Race [general version]"'
label var bpl `"Birthplace [general version]"'
label var yrimmig `"Year of immigration"'
label var educd `"Educational attainment [detailed version]"'
label var empstat `"Employment status [general version]"'
label var classwkr `"Class of worker [general version]"'
label var wkswork1 `"Weeks worked last year"'
label var uhrswork `"Usual hours worked per week"'
label var incwage `"Wage and salary income"'

label define regionlbl 11 `"New England Division"', add
label define regionlbl 12 `"Middle Atlantic Division"', add
label define regionlbl 13 `"Mixed Northeast Divisions (1970 Metro)"', add
label define regionlbl 21 `"East North Central Div."', add
label define regionlbl 22 `"West North Central Div."', add
label define regionlbl 23 `"Mixed Midwest Divisions (1970 Metro)"', add
label define regionlbl 31 `"South Atlantic Division"', add
label define regionlbl 32 `"East South Central Div."', add
label define regionlbl 33 `"West South Central Div."', add
label define regionlbl 34 `"Mixed Southern Divisions (1970 Metro)"', add
label define regionlbl 41 `"Mountain Division"', add
label define regionlbl 42 `"Pacific Division"', add
label define regionlbl 43 `"Mixed Western Divisions (1970 Metro)"', add
label define regionlbl 91 `"Military/Military reservations"', add
label define regionlbl 92 `"PUMA boundaries cross state lines-1% sample"', add
label define regionlbl 97 `"State not identified"', add
label define regionlbl 99 `"Not identified"', add
label values region regionlbl

label define statefiplbl 01 `"Alabama"'
label define statefiplbl 02 `"Alaska"', add
label define statefiplbl 04 `"Arizona"', add
label define statefiplbl 05 `"Arkansas"', add
label define statefiplbl 06 `"California"', add
label define statefiplbl 08 `"Colorado"', add
label define statefiplbl 09 `"Connecticut"', add
label define statefiplbl 10 `"Delaware"', add
label define statefiplbl 11 `"District of Columbia"', add
label define statefiplbl 12 `"Florida"', add
label define statefiplbl 13 `"Georgia"', add
label define statefiplbl 15 `"Hawaii"', add
label define statefiplbl 16 `"Idaho"', add
label define statefiplbl 17 `"Illinois"', add
label define statefiplbl 18 `"Indiana"', add
label define statefiplbl 19 `"Iowa"', add
label define statefiplbl 20 `"Kansas"', add
label define statefiplbl 21 `"Kentucky"', add
label define statefiplbl 22 `"Louisiana"', add
label define statefiplbl 23 `"Maine"', add
label define statefiplbl 24 `"Maryland"', add
label define statefiplbl 25 `"Massachusetts"', add
label define statefiplbl 26 `"Michigan"', add
label define statefiplbl 27 `"Minnesota"', add
label define statefiplbl 28 `"Mississippi"', add
label define statefiplbl 29 `"Missouri"', add
label define statefiplbl 30 `"Montana"', add
label define statefiplbl 31 `"Nebraska"', add
label define statefiplbl 32 `"Nevada"', add
label define statefiplbl 33 `"New Hampshire"', add
label define statefiplbl 34 `"New Jersey"', add
label define statefiplbl 35 `"New Mexico"', add
label define statefiplbl 36 `"New York"', add
label define statefiplbl 37 `"North Carolina"', add
label define statefiplbl 38 `"North Dakota"', add
label define statefiplbl 39 `"Ohio"', add
label define statefiplbl 40 `"Oklahoma"', add
label define statefiplbl 41 `"Oregon"', add
label define statefiplbl 42 `"Pennsylvania"', add
label define statefiplbl 44 `"Rhode Island"', add
label define statefiplbl 45 `"South Carolina"', add
label define statefiplbl 46 `"South Dakota"', add
label define statefiplbl 47 `"Tennessee"', add
label define statefiplbl 48 `"Texas"', add
label define statefiplbl 49 `"Utah"', add
label define statefiplbl 50 `"Vermont"', add
label define statefiplbl 51 `"Virginia"', add
label define statefiplbl 53 `"Washington"', add
label define statefiplbl 54 `"West Virginia"', add
label define statefiplbl 55 `"Wisconsin"', add
label define statefiplbl 56 `"Wyoming"', add
label define statefiplbl 61 `"Maine-New Hampshire-Vermont"', add
label define statefiplbl 62 `"Massachusetts-Rhode Island"', add
label define statefiplbl 63 `"Minnesota-Iowa-Missouri-Kansas-Nebraska-S.Dakota-N.Dakota"', add
label define statefiplbl 64 `"Maryland-Delaware"', add
label define statefiplbl 65 `"Montana-Idaho-Wyoming"', add
label define statefiplbl 66 `"Utah-Nevada"', add
label define statefiplbl 67 `"Arizona-New Mexico"', add
label define statefiplbl 68 `"Alaska-Hawaii"', add
label define statefiplbl 72 `"Puerto Rico"', add
label define statefiplbl 97 `"Military/Mil. Reservation"', add
label define statefiplbl 99 `"State not identified"', add
label values statefip statefiplbl

label define metrolbl 0 `"Not identifiable"'
label define metrolbl 1 `"Not in metro area"', add
label define metrolbl 2 `"In metro area, central city"', add
label define metrolbl 3 `"In metro, area, outside central city"', add
label define metrolbl 4 `"Central city status unknown"', add
label values metro metrolbl

label define gqlbl 0 `"Vacant unit"'
label define gqlbl 1 `"Households under 1970 definition"', add
label define gqlbl 2 `"Additional households under 1990 definition"', add
label define gqlbl 3 `"Group quarters--Institutions"', add
label define gqlbl 4 `"Other group quarters"', add
label define gqlbl 5 `"Additional households under 2000 definition"', add
label define gqlbl 6 `"Fragment"', add
label values gq gqlbl

label define agelbl 000 `"Less than 1 year old"'
label define agelbl 001 `"1"', add
label define agelbl 002 `"2"', add
label define agelbl 003 `"3"', add
label define agelbl 004 `"4"', add
label define agelbl 005 `"5"', add
label define agelbl 006 `"6"', add
label define agelbl 007 `"7"', add
label define agelbl 008 `"8"', add
label define agelbl 009 `"9"', add
label define agelbl 010 `"10"', add
label define agelbl 011 `"11"', add
label define agelbl 012 `"12"', add
label define agelbl 013 `"13"', add
label define agelbl 014 `"14"', add
label define agelbl 015 `"15"', add
label define agelbl 016 `"16"', add
label define agelbl 017 `"17"', add
label define agelbl 018 `"18"', add
label define agelbl 019 `"19"', add
label define agelbl 020 `"20"', add
label define agelbl 021 `"21"', add
label define agelbl 022 `"22"', add
label define agelbl 023 `"23"', add
label define agelbl 024 `"24"', add
label define agelbl 025 `"25"', add
label define agelbl 026 `"26"', add
label define agelbl 027 `"27"', add
label define agelbl 028 `"28"', add
label define agelbl 029 `"29"', add
label define agelbl 030 `"30"', add
label define agelbl 031 `"31"', add
label define agelbl 032 `"32"', add
label define agelbl 033 `"33"', add
label define agelbl 034 `"34"', add
label define agelbl 035 `"35"', add
label define agelbl 036 `"36"', add
label define agelbl 037 `"37"', add
label define agelbl 038 `"38"', add
label define agelbl 039 `"39"', add
label define agelbl 040 `"40"', add
label define agelbl 041 `"41"', add
label define agelbl 042 `"42"', add
label define agelbl 043 `"43"', add
label define agelbl 044 `"44"', add
label define agelbl 045 `"45"', add
label define agelbl 046 `"46"', add
label define agelbl 047 `"47"', add
label define agelbl 048 `"48"', add
label define agelbl 049 `"49"', add
label define agelbl 050 `"50"', add
label define agelbl 051 `"51"', add
label define agelbl 052 `"52"', add
label define agelbl 053 `"53"', add
label define agelbl 054 `"54"', add
label define agelbl 055 `"55"', add
label define agelbl 056 `"56"', add
label define agelbl 057 `"57"', add
label define agelbl 058 `"58"', add
label define agelbl 059 `"59"', add
label define agelbl 060 `"60"', add
label define agelbl 061 `"61"', add
label define agelbl 062 `"62"', add
label define agelbl 063 `"63"', add
label define agelbl 064 `"64"', add
label define agelbl 065 `"65"', add
label define agelbl 066 `"66"', add
label define agelbl 067 `"67"', add
label define agelbl 068 `"68"', add
label define agelbl 069 `"69"', add
label define agelbl 070 `"70"', add
label define agelbl 071 `"71"', add
label define agelbl 072 `"72"', add
label define agelbl 073 `"73"', add
label define agelbl 074 `"74"', add
label define agelbl 075 `"75"', add
label define agelbl 076 `"76"', add
label define agelbl 077 `"77"', add
label define agelbl 078 `"78"', add
label define agelbl 079 `"79"', add
label define agelbl 080 `"80"', add
label define agelbl 081 `"81"', add
label define agelbl 082 `"82"', add
label define agelbl 083 `"83"', add
label define agelbl 084 `"84"', add
label define agelbl 085 `"85"', add
label define agelbl 086 `"86"', add
label define agelbl 087 `"87"', add
label define agelbl 088 `"88"', add
label define agelbl 089 `"89"', add
label define agelbl 090 `"90 (90+ in 1980 and 1990)"', add
label define agelbl 091 `"91"', add
label define agelbl 092 `"92"', add
label define agelbl 093 `"93"', add
label define agelbl 094 `"94"', add
label define agelbl 095 `"95"', add
label define agelbl 096 `"96"', add
label define agelbl 097 `"97"', add
label define agelbl 098 `"98"', add
label define agelbl 099 `"99"', add
label define agelbl 100 `"100 (100+ in 1970)"', add
label define agelbl 101 `"101"', add
label define agelbl 102 `"102"', add
label define agelbl 103 `"103"', add
label define agelbl 104 `"104"', add
label define agelbl 105 `"105"', add
label define agelbl 106 `"106"', add
label define agelbl 107 `"107"', add
label define agelbl 108 `"108"', add
label define agelbl 109 `"109"', add
label define agelbl 110 `"110"', add
label define agelbl 111 `"111"', add
label define agelbl 112 `"112 (112+ in the 1980 internal data)"', add
label define agelbl 113 `"113"', add
label define agelbl 114 `"114"', add
label define agelbl 115 `"115 (115+ in the 1990 internal data)"', add
label define agelbl 116 `"116"', add
label define agelbl 117 `"117"', add
label define agelbl 118 `"118"', add
label define agelbl 119 `"119"', add
label define agelbl 120 `"120"', add
label define agelbl 121 `"121"', add
label define agelbl 122 `"122"', add
label define agelbl 123 `"123"', add
label define agelbl 124 `"124"', add
label define agelbl 125 `"125"', add
label define agelbl 126 `"126"', add
label define agelbl 129 `"129"', add
label define agelbl 130 `"130"', add
label define agelbl 135 `"135"', add
label values age agelbl

label define sexlbl 1 `"Male"'
label define sexlbl 2 `"Female"', add
label values sex sexlbl

label define marstlbl 1 `"Married, spouse present"'
label define marstlbl 2 `"Married, spouse absent"', add
label define marstlbl 3 `"Separated"', add
label define marstlbl 4 `"Divorced"', add
label define marstlbl 5 `"Widowed"', add
label define marstlbl 6 `"Never married/single"', add
label values marst marstlbl

label define racelbl 1 `"White"'
label define racelbl 2 `"Black/Negro"', add
label define racelbl 3 `"American Indian or Alaska Native"', add
label define racelbl 4 `"Chinese"', add
label define racelbl 5 `"Japanese"', add
label define racelbl 6 `"Other Asian or Pacific Islander"', add
label define racelbl 7 `"Other race, nec"', add
label define racelbl 8 `"Two major races"', add
label define racelbl 9 `"Three or more major races"', add
label values race racelbl

label define bpllbl 001 `"Alabama"', add
label define bpllbl 002 `"Alaska"', add
label define bpllbl 004 `"Arizona"', add
label define bpllbl 005 `"Arkansas"', add
label define bpllbl 006 `"California"', add
label define bpllbl 008 `"Colorado"', add
label define bpllbl 009 `"Connecticut"', add
label define bpllbl 010 `"Delaware"', add
label define bpllbl 011 `"District of Columbia"', add
label define bpllbl 012 `"Florida"', add
label define bpllbl 013 `"Georgia"', add
label define bpllbl 015 `"Hawaii"', add
label define bpllbl 016 `"Idaho"', add
label define bpllbl 017 `"Illinois"', add
label define bpllbl 018 `"Indiana"', add
label define bpllbl 019 `"Iowa"', add
label define bpllbl 020 `"Kansas"', add
label define bpllbl 021 `"Kentucky"', add
label define bpllbl 022 `"Louisiana"', add
label define bpllbl 023 `"Maine"', add
label define bpllbl 024 `"Maryland"', add
label define bpllbl 025 `"Massachusetts"', add
label define bpllbl 026 `"Michigan"', add
label define bpllbl 027 `"Minnesota"', add
label define bpllbl 028 `"Mississippi"', add
label define bpllbl 029 `"Missouri"', add
label define bpllbl 030 `"Montana"', add
label define bpllbl 031 `"Nebraska"', add
label define bpllbl 032 `"Nevada"', add
label define bpllbl 033 `"New Hampshire"', add
label define bpllbl 034 `"New Jersey"', add
label define bpllbl 035 `"New Mexico"', add
label define bpllbl 036 `"New York"', add
label define bpllbl 037 `"North Carolina"', add
label define bpllbl 038 `"North Dakota"', add
label define bpllbl 039 `"Ohio"', add
label define bpllbl 040 `"Oklahoma"', add
label define bpllbl 041 `"Oregon"', add
label define bpllbl 042 `"Pennsylvania"', add
label define bpllbl 044 `"Rhode Island"', add
label define bpllbl 045 `"South Carolina"', add
label define bpllbl 046 `"South Dakota"', add
label define bpllbl 047 `"Tennessee"', add
label define bpllbl 048 `"Texas"', add
label define bpllbl 049 `"Utah"', add
label define bpllbl 050 `"Vermont"', add
label define bpllbl 051 `"Virginia"', add
label define bpllbl 053 `"Washington"', add
label define bpllbl 054 `"West Virginia"', add
label define bpllbl 055 `"Wisconsin"', add
label define bpllbl 056 `"Wyoming"', add
label define bpllbl 090 `"Native American"', add
label define bpllbl 099 `"United States, ns"', add
label define bpllbl 100 `"American Samoa"', add
label define bpllbl 105 `"Guam"', add
label define bpllbl 110 `"Puerto Rico"', add
label define bpllbl 115 `"U.S. Virgin Islands"', add
label define bpllbl 120 `"Other US Possessions"', add
label define bpllbl 150 `"Canada"', add
label define bpllbl 155 `"St. Pierre and Miquelon"', add
label define bpllbl 160 `"Atlantic Islands"', add
label define bpllbl 199 `"North America, ns"', add
label define bpllbl 200 `"Mexico"', add
label define bpllbl 210 `"Central America"', add
label define bpllbl 250 `"Cuba"', add
label define bpllbl 260 `"West Indies"', add
label define bpllbl 300 `"SOUTH AMERICA"', add
label define bpllbl 400 `"Denmark"', add
label define bpllbl 401 `"Finland"', add
label define bpllbl 402 `"Iceland"', add
label define bpllbl 403 `"Lapland, n.s."', add
label define bpllbl 404 `"Norway"', add
label define bpllbl 405 `"Sweden"', add
label define bpllbl 410 `"England"', add
label define bpllbl 411 `"Scotland"', add
label define bpllbl 412 `"Wales"', add
label define bpllbl 413 `"United Kingdom, ns"', add
label define bpllbl 414 `"Ireland"', add
label define bpllbl 419 `"Northern Europe, ns"', add
label define bpllbl 420 `"Belgium"', add
label define bpllbl 421 `"France"', add
label define bpllbl 422 `"Liechtenstein"', add
label define bpllbl 423 `"Luxembourg"', add
label define bpllbl 424 `"Monaco"', add
label define bpllbl 425 `"Netherlands"', add
label define bpllbl 426 `"Switerland"', add
label define bpllbl 429 `"Western Europe, ns"', add
label define bpllbl 430 `"Albania"', add
label define bpllbl 431 `"Andorra"', add
label define bpllbl 432 `"Gibraltar"', add
label define bpllbl 433 `"Greece"', add
label define bpllbl 434 `"Italy"', add
label define bpllbl 435 `"Malta"', add
label define bpllbl 436 `"Portugal"', add
label define bpllbl 437 `"San Marino"', add
label define bpllbl 438 `"Spain"', add
label define bpllbl 439 `"Vatican City"', add
label define bpllbl 440 `"Southern Europe, ns"', add
label define bpllbl 450 `"Austria"', add
label define bpllbl 451 `"Bulgaria"', add
label define bpllbl 452 `"Czechoslovakia"', add
label define bpllbl 453 `"Germany"', add
label define bpllbl 454 `"Hungary"', add
label define bpllbl 455 `"Poland"', add
label define bpllbl 456 `"Romania"', add
label define bpllbl 457 `"Yugoslavia"', add
label define bpllbl 458 `"Central Europe, ns"', add
label define bpllbl 459 `"Eastern Europe, ns"', add
label define bpllbl 460 `"Estonia"', add
label define bpllbl 461 `"Latvia"', add
label define bpllbl 462 `"Lithuania"', add
label define bpllbl 463 `"Baltic States, ns"', add
label define bpllbl 465 `"Other USSR/Russia"', add
label define bpllbl 499 `"Europe, ns"', add
label define bpllbl 500 `"China"', add
label define bpllbl 501 `"Japan"', add
label define bpllbl 502 `"Korea"', add
label define bpllbl 509 `"East Asia, ns"', add
label define bpllbl 510 `"Brunei"', add
label define bpllbl 511 `"Cambodia (Kampuchea)"', add
label define bpllbl 512 `"Indonesia"', add
label define bpllbl 513 `"Laos"', add
label define bpllbl 514 `"Malaysia"', add
label define bpllbl 515 `"Philippines"', add
label define bpllbl 516 `"Singapore"', add
label define bpllbl 517 `"Thailand"', add
label define bpllbl 518 `"Vietnam"', add
label define bpllbl 519 `"Southeast Asia, ns"', add
label define bpllbl 520 `"Afghanistan"', add
label define bpllbl 521 `"India"', add
label define bpllbl 522 `"Iran"', add
label define bpllbl 523 `"Maldives"', add
label define bpllbl 524 `"Nepal"', add
label define bpllbl 530 `"Bahrain"', add
label define bpllbl 531 `"Cyprus"', add
label define bpllbl 532 `"Iraq"', add
label define bpllbl 533 `"Iraq/Saudi Arabia"', add
label define bpllbl 534 `"Israel/Palestine"', add
label define bpllbl 535 `"Jordan"', add
label define bpllbl 536 `"Kuwait"', add
label define bpllbl 537 `"Lebanon"', add
label define bpllbl 538 `"Oman"', add
label define bpllbl 539 `"Qatar"', add
label define bpllbl 540 `"Saudi Arabia"', add
label define bpllbl 541 `"Syria"', add
label define bpllbl 542 `"Turkey"', add
label define bpllbl 543 `"United Arab Emirates"', add
label define bpllbl 544 `"Yemen Arab Republic (North)"', add
label define bpllbl 545 `"Yemen, PDR (South)"', add
label define bpllbl 546 `"Persian Gulf States, n.s."', add
label define bpllbl 547 `"Middle East, ns"', add
label define bpllbl 548 `"Southwest Asia, nec/ns"', add
label define bpllbl 549 `"Asia Minor, ns"', add
label define bpllbl 550 `"South Asia, nec"', add
label define bpllbl 599 `"Asia, nec/ns"', add
label define bpllbl 600 `"AFRICA"', add
label define bpllbl 700 `"Australia and New Zealand"', add
label define bpllbl 710 `"Pacific Islands"', add
label define bpllbl 800 `"Antarctica, ns/nec"', add
label define bpllbl 900 `"Abroad (unknown) or at sea"', add
label define bpllbl 950 `"Other, nec"', add
label define bpllbl 999 `"Missing/blank"', add
label values bpl bpllbl

label define educdlbl 000 `"N/A or no schooling"'
label define educdlbl 001 `"N/A"', add
label define educdlbl 002 `"No schooling completed"', add
label define educdlbl 010 `"Nursery school to grade 4"', add
label define educdlbl 011 `"Nursery school, preschool"', add
label define educdlbl 012 `"Kindergarten"', add
label define educdlbl 013 `"Grade 1, 2, 3, or 4"', add
label define educdlbl 014 `"Grade 1"', add
label define educdlbl 015 `"Grade 2"', add
label define educdlbl 016 `"Grade 3"', add
label define educdlbl 017 `"Grade 4"', add
label define educdlbl 020 `"Grade 5, 6, 7, or 8"', add
label define educdlbl 021 `"Grade 5 or 6"', add
label define educdlbl 022 `"Grade 5"', add
label define educdlbl 023 `"Grade 6"', add
label define educdlbl 024 `"Grade 7 or 8"', add
label define educdlbl 025 `"Grade 7"', add
label define educdlbl 026 `"Grade 8"', add
label define educdlbl 030 `"Grade 9"', add
label define educdlbl 040 `"Grade 10"', add
label define educdlbl 050 `"Grade 11"', add
label define educdlbl 060 `"Grade 12"', add
label define educdlbl 061 `"12th grade, no diploma"', add
label define educdlbl 062 `"High school graduate or GED"', add
label define educdlbl 063 `"Regular high school diploma"', add
label define educdlbl 064 `"GED or alternative credential"', add
label define educdlbl 065 `"Some college, but less than 1 year"', add
label define educdlbl 070 `"1 year of college"', add
label define educdlbl 071 `"1 or more years of college credit, no degree"', add
label define educdlbl 080 `"2 years of college"', add
label define educdlbl 081 `"Associate's degree, type not specified"', add
label define educdlbl 082 `"Associate's degree, occupational program"', add
label define educdlbl 083 `"Associate's degree, academic program"', add
label define educdlbl 090 `"3 years of college"', add
label define educdlbl 100 `"4 years of college"', add
label define educdlbl 101 `"Bachelor's degree"', add
label define educdlbl 110 `"5+ years of college"', add
label define educdlbl 111 `"6 years of college (6+ in 1960-1970)"', add
label define educdlbl 112 `"7 years of college"', add
label define educdlbl 113 `"8+ years of college"', add
label define educdlbl 114 `"Master's degree"', add
label define educdlbl 115 `"Professional degree beyond a bachelor's degree"', add
label define educdlbl 116 `"Doctoral degree"', add
label values educd educdlbl

label define empstatlbl 0 `"N/A"'
label define empstatlbl 1 `"Employed"', add
label define empstatlbl 2 `"Unemployed"', add
label define empstatlbl 3 `"Not in labor force"', add
label values empstat empstatlbl

label define classwkrlbl 0 `"N/A"'
label define classwkrlbl 1 `"Self-employed"', add
label define classwkrlbl 2 `"Works for wages"', add
label values classwkr classwkrlbl


save using us2000, replace

